#pragma once

class World;
class GameStateObject;

namespace ZeEngine
{
    class Event;
}

class BaseSystem : public IComponentSystem
{
    enum class BaseState
    {
        None, Breakfast, Night
    };

public:
    BaseSystem(std::shared_ptr<GameStateObject> pGameStateObject, GameEngine& gameEngine);
    virtual ~BaseSystem();

    //IComponentSystem
    virtual bool Init(ZeEngine::GameEngine& gameEngine) override;
    virtual bool Update(ZeEngine::GameEngine& gameEngine) override;
    virtual void Destroy(ZeEngine::GameEngine& gameEngine) override;

private:
    void CheckTime();
    bool ChangeState(BaseState newState);

    void DoBreakfastState();
    void DoNightState();

private:
    std::shared_ptr<GameStateObject>    m_pGameStateObject;
    GameEngine&                         m_GameEngine;

    BaseState                           m_state;
    BaseState                           m_previousState;

    Entity*                             m_pTempEntity;
private:
    static const u32                    cBreakfastHour;
    static const u32                    cNightHour;

};

